# i = 0
# j = 0
# a=[]
# count = 0
# while j <= 10:
#     while i<=10:
#         if i % 2 != 0:
#             a.append(i)
#             count+=1
#         i+=1
#         if i % 10 == 0:
#             print("\n")
#     j+=1
# print(a)

# i=1
# keys = ""
# values = ""
# dict={}
# while keys != "0" and values != "0":
#     keys = input(f"请输入第{i}个英雄的名字：")
#     values = input(f"请输入第{i}个英雄的武器：")
#     dict[keys] = values
#     i += 1
# for k in dict:
#     print(k+":"+dict[k])


class Hero:
    def __init__(self,name,weap):
        print('初始化函数',self)
        self.name = name
        self.weap = weap
        # 普通方法
    def print_msg(self):
        print(f"英雄的名字是{self.name},武器是:{self.weap}")
    def trace(self):
        print("第二个方法")
if __name__ == '__main__':
    hero_list=[]
    # 创建对象
    for i in range(1,6):
        name = input(f"请输入第{i}个英雄的名字:\t")
        weap = input(f"请输入第{i}个英雄的武器:\t")
        # 组装成英雄的对象
        hero = Hero(name,weap)
        #存到列表中
        hero_list.append(hero)
    print(f'英雄池的大小：{len(hero_list)}')
    for one_hero in hero_list:
        one_hero.print_msg()